package com.zeei.gis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zeei.common.controller.BasicController;
import com.zeei.common.vo.ResultRowsVO;
import com.zeei.gis.service.EmissionGisService;
import com.zeei.gis.vo.EmissionGisVO;

/**
 * <pre>
 *project: pls
 *src: com.zeei.gis.controller.EmissionController
 *builder: meng.jy
 *date: 2018年1月12日
 *Description: 排放量入口
 * </pre>
 */
@Controller("EmissionGisController")
@RequestMapping("/gis/emission")
public class EmissionGisController extends BasicController {

	@Autowired
	@Qualifier("EmissionGisServiceImpl")
	private EmissionGisService emissionGisService;

	/**
	 * 
	 * queryPolyList: 查询排放量聚合数据集
	 *
	 * @param vo
	 * @return ResultRowsVO<EmissionGisVO>
	 */
	@RequestMapping(value = "/polyList", method = RequestMethod.POST)
	@ResponseBody
	public ResultRowsVO<EmissionGisVO> queryPolyList(EmissionGisVO vo) {

		List<EmissionGisVO> retList = this.emissionGisService.queryPolyList(vo);
		if (retList == null || retList.isEmpty() || retList.size() < 1) {
			return this.createResultRowsVO(null, false, "没有查询到数据", 0);
		}
		return this.createResultRowsVO(retList, true, null, retList.size());
	}

	/**
	 * 
	 * queryMultiPointList: 查询排放量多点数据集
	 *
	 * @param vo
	 * @return ResultRowsVO<EmissionGisVO>
	 */
	@RequestMapping(value = "/multiPointList", method = RequestMethod.POST)
	@ResponseBody
	public ResultRowsVO<EmissionGisVO> queryMultiPointList(EmissionGisVO vo) {

		List<EmissionGisVO> retList = this.emissionGisService.queryMultiPointList(vo);
		if (retList == null || retList.isEmpty() || retList.size() < 1) {
			return this.createResultRowsVO(null, false, "没有查询到数据", 0);
		}
		return this.createResultRowsVO(retList, true, null, retList.size());
	}

	/**
	 * 
	 * queryPolyRankList: 查询排放量聚合占比排序
	 *
	 * @param vo
	 * @return ResultRowsVO<EmissionGisVO>
	 */
	@RequestMapping(value = "/polyRankList", method = RequestMethod.POST)
	@ResponseBody
	public ResultRowsVO<EmissionGisVO> queryPolyRankList(EmissionGisVO vo) {

		List<EmissionGisVO> retList = this.emissionGisService.queryPolyRankList(vo);
		if (retList == null || retList.isEmpty() || retList.size() < 1) {
			return this.createResultRowsVO(null, false, "没有查询到数据", 0);
		}
		return this.createResultRowsVO(retList, true, null, retList.size());
	}

	/**
	 * 
	 * queryMultiPointRankList: 查询排放量多点数据集占比排序
	 *
	 * @param vo
	 * @return ResultRowsVO<EmissionGisVO>
	 */
	@RequestMapping(value = "/multiPointRankList", method = RequestMethod.POST)
	@ResponseBody
	public ResultRowsVO<EmissionGisVO> queryMultiPointRankList(EmissionGisVO vo) {

		List<EmissionGisVO> retList = this.emissionGisService.queryMultiPointRankList(vo);
		if (retList == null || retList.isEmpty() || retList.size() < 1) {
			return this.createResultRowsVO(null, false, "没有查询到数据", 0);
		}
		return this.createResultRowsVO(retList, true, null, retList.size());
	}
}
